<%@ page language="java"  pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <%
        String path = request.getContextPath();
        String http = request.getScheme();
        String ips = request.getServerName();
        int port = request.getServerPort();
//        http://localhost:8082/shop/
        String basePath = http+"://"+ips+":"+port+path+"/";
    %>
    <base href="<%=basePath%>">
    <title>用户注册</title>
    <link type="text/css" href="${pageContext.request.contextPath}/resources/css/regLogin.css" rel="stylesheet">
</head>

<body>
<div class="box reg">
    <form action="${pageContext.request.contextPath}/RegisterServlet" method="post">
        <div class="register">
            <h2>
                注册
            </h2>
            <p>
                <span>用户名:</span>

                <input type="text" name="username"/>
            </p>
            <p>
                <span>密&emsp;码:</span>
                <input type="password" name="password"/>
            </p>
            <p>
                <span>手机号:</span>
                <input type="text" name="phone"/>
            </p>
            <p>
                <span>年&emsp;龄:</span>
                <input type="text" name="age"/>
            </p>
            <p>
                <span>性&emsp;别:</span>
                <label>
                    <input type="radio" name="sex" value="0" />男
                    <input type="radio" name="sex" value="1" />女
                </label>

            </p>
            <p>
                <span>角&emsp;色:</span>
                <select name="roleId">
                    <option>请选择</option>
                    <option value="2">用户</option>
                    <option value="1">管理员</option>
                </select>
            </p>
            <p>
                <input id="reg" type="submit" value="立即注册"/>
            </p>
            <p style="color: red">
                ${requestScope.msg}
            </p>
            <p>
                已有账号？<a href="${pageContext.request.contextPath}/ToLoginServlet">请登录</a>
            </p>
        </div>
    </form>
</div>
</body>
</html>
